import React, {Component} from "react";
import ReactDOM from "react-dom";
import Child from "./Child"

export default class Demo extends Component {
    constructor(porps) {
        super(porps)
        this.lqf = 5454
        this.state = {
            count: this.lqf || 2
        }

    }

    getInitialState() {
        console.log("父组件getInitialState()")
    }


    getDefaultProps() {

        console.log("后决定胜负的")
    }

    componentWillUpdate(nextProps, nextState, nextContext) {
        console.log("这是我的天下")
    }


    componentWillMount() {
        console.log("哈哈")
    }


    handleadd = () => {
        this.setState(
            {count: this.state.count + 1}
        )
    }


    render() {
        return <div className="App">
            <button onClick={this.handleadd}>点击一下</button>
            <h1>Please fork this codesandbox to reproduce your issue.</h1>
            <div style={{marginTop: "16px"}}>
                <div style={{color: "red"}}>严寺街</div>
            </div>
            <p>{this.state.count}</p>

            <Child name={"刘一鸣"}/>

        </div>
    }

}


